﻿/**********************************************************************
 * @file   FITKAcousticsVTKGraphObjectFEJunctionPoint.h
 * @brief  FE点连接渲染对象
 * @author BaGuijun (baguijun@163.com)
 * @date   2025-02-08
 *********************************************************************/
#ifndef __FITKACOUSTICSVTKGRAPHOBJECTSEAJUNCTIONPOINT_H__
#define __FITKACOUSTICSVTKGRAPHOBJECTSEAJUNCTIONPOINT_H__

#include "FITKAcousticsVTKGraphObjectJunctionBase.h"
#include "FITKAcousticsVTKGraphAdaptorAPI.h"

 // Forward declaration
class vtkUnstructuredGrid;
class vtkPoints;
class vtkGlyph3D;
class vtkSphereSource;

class FITKAcousticsVTKGraphActor;

namespace Acoustics
{
    class FITKFEJunctionPoint;
}

namespace Exchange
{
    class FITKAcousticsVTKGraphObjectSelect;
}

namespace Exchange
{
    /**
     * @brief  FE点连接渲染对象
     * @author BaGuijun (baguijun@163.com)
     * @date   2025-02-08
     */
    class FITKACOUSTICSGRAPHADAPTORAPI FITKAcousticsVTKGraphObjectFEJunctionPoint : public FITKAcousticsVTKGraphObjectJunctionBase
    {
        // Regist
        FITKGraphObjectRegist(FITKAcousticsVTKGraphObjectFEJunctionPoint, FITKAcousticsVTKGraphObjectJunctionBase);
        FITKCLASS(Exchange, FITKAcousticsVTKGraphObjectFEJunctionPoint);

    public:
        /**
         * @brief    构造函数
         * @param[i] jPoint                    点连接对象
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-08
         */
        FITKAcousticsVTKGraphObjectFEJunctionPoint(Acoustics::FITKFEJunctionPoint* jPoint);
        /**
         * @brief    析构函数
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-08
         */
        virtual ~FITKAcousticsVTKGraphObjectFEJunctionPoint();
        /**
         * @brief    更新可见性
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-08
         */
        void updateVisibility() override;
    private:
        /**
         * @brief    初始化
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-08
         */
        void init() override;
        /**
         * @brief    生成数据集
         * @param[i] junction                       连接对象
         * @return   bool                           是否成功
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-08
         */
        bool generateDataSet(Acoustics::FITKAbstractJunction* junction) override;
        /**
         * @brief    生成渲染对象
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-08
         */
        void generateGraph() override;
        /**
         * @brief    更新尺寸
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-08
         */
        void updateGlyphSizeByRatio() override;
        /**
         * @brief    重置VTK数据
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-08
         */
        void resetVtkData();
    private:
        /**
         * @brief  尺寸
         * @author BaGuijun (baguijun@163.com)
         * @date   2025-02-08
         */
        double m_glyphSize = 30.;
        /**
         * @brief  点数据生成过滤器
         * @author BaGuijun (baguijun@163.com)
         * @date   2025-02-08
         */
        vtkGlyph3D* m_glyph{ nullptr };
        /**
         * @brief  点数据源
         * @author BaGuijun (baguijun@163.com)
         * @date   2025-02-08
         */
        vtkSphereSource* m_sphereSource{ nullptr };
        /**
         * @brief  线网格数据
         * @author BaGuijun (baguijun@163.com)
         * @date   2025-02-08
         */
        vtkUnstructuredGrid* m_ugridLine{ nullptr };
        /**
         * @brief  线点集
         * @author BaGuijun (baguijun@163.com)
         * @date   2025-02-08
         */
        vtkPoints* m_pointsLine{ nullptr };
        /**
         * @brief  线可视化对象
         * @author BaGuijun (baguijun@163.com)
         * @date   2025-02-08
         */
        FITKAcousticsVTKGraphActor* m_fActorLine{ nullptr };

    };
}   // namespace Exchange

#endif // __FITKACOUSTICSVTKGRAPHOBJECTSEAJUNCTIONPOINT_H__
